# encoding=utf-8
# author:梁子龙
# encoding=utf-8
# author:梁子龙

from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json
# 加载当前蓝图中的所有资源
from asys_main.resource.ariticle.article_resource import *

article_bp = Blueprint('article', __name__, url_prefix='/api')  # 创建蓝图
article_api = Api(article_bp)

# 使用定制好的返回到前端的json格式
article_api.representation('application/json')(output_json)
article_api.add_resource(ArticleInfo, '/article', endpoint='article')  # 登录的资源
article_api.add_resource(ArticleView, '/article/<int:id>', endpoint='/article/<int:id>')  # 登录的资源
article_api.add_resource(ArticleLike, '/article/like/<int:id>', endpoint='/article/like/<int:id>')  # 登录的资源
